package com.yidong;

import com.YDCommonUtils;
import com.yidong.entity.YiDongObj;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * 后向合同
 */
public class HeTong extends YDCommonUtils {

    public static String inPath = "D:\\code\\Projects\\yidong\\src\\main\\java\\com\\yidongcfg\\合同模板\\";
    public static String outPath = "D:\\code\\Projects\\yidong\\src\\main\\java\\com\\yidongcfg\\";

    //后向合同无锡
    public void wuxi(){
        HeTong heTong = new HeTong();
        YiDongObj obj = new YiDongObj();
        heTong.wordUtils(obj,inPath,outPath,"合同无锡.docx","后向");
    }

    //后向合同集成
    public void jicheng(){
        HeTong heTong = new HeTong();
        YiDongObj obj = new YiDongObj();
        heTong.wordUtils(obj,inPath,outPath,"合同集成.docx","后向");
    }

    @Override
    public String changeText(String runText, YiDongObj obj) {
        //后向合同
        runText = runText.replaceAll("易项目名称易",obj.getXmmc());
        runText = runText.replaceAll("易前向单位易",obj.getHtqxdw());
        runText = runText.replaceAll("易后向单位易",obj.getHthxdw());
        runText = runText.replaceAll("易工期易",obj.getHtgq());
        runText = runText.replaceAll("易后向金额易",obj.getHxje());
        runText = runText.replaceAll("易前向金额易",obj.getHxje());
        runText = runText.replaceAll("易售后维保期易",obj.getShwbq());
        runText = runText.replaceAll("易合同期限易",obj.getHthtqx());
        runText = runText.replaceAll("易后向付款方式易",obj.getHxfkfs());
        runText = runText.replaceAll("易服务内容易",obj.getFwnr());

        return runText;
    }
}
